﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.IO;

using Happy.CodeRule;

namespace Happy.CodeRule.Test
{
    [TestClass]
    public class FileSeedStoreTest
    {
        [TestMethod]
        public void NextSeed_Test()
        {
            var seedKey = "销售订单";
            var file = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "App_Seeds", seedKey + ".txt");
            if (File.Exists(file))
            {
                File.Delete(file);
            }

            var seedStore = new FileSeedStore();

            Assert.AreEqual(1, seedStore.NextSeed(seedKey));
            Assert.AreEqual(2, seedStore.NextSeed(seedKey));
            Assert.AreEqual(3, seedStore.NextSeed(seedKey));
        }
    }
}
